package cn.wxManage.goodsManage.controller;

import cn.common.common.model.ServerResponse;
import cn.wxManage.goodsManage.service.IGoodsCollectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created by Zhang on 2019/1/25.
 */
@RestController
@RequestMapping("/goodsCollect")
@Api(value="用户收藏相关方法",description = "用户收藏相关方法")
public class GoodsCollectController {
    @Autowired
    IGoodsCollectService iGoodsCollectService;

    @ApiOperation(value="变更收藏的商品", notes="添加收藏的商品",produces = "application/json")
    @ApiImplicitParam(name = "goodsId", value = "商品Id",paramType ="query",dataType = "Integer")
    @GetMapping(value = "/handleGoodsToCollect")
    public ServerResponse<?> handleGoodsToCollect(@RequestParam("goodsId") Integer goodsId){
        return iGoodsCollectService.handleGoodsToCollect(goodsId);
    }

    @ApiOperation(value="获取收藏的商品", notes="获取收藏的商品",produces = "application/json")
    @GetMapping(value = "/getGoodsToCollect")
    public ServerResponse<?> getGoodsToCollect(){
        return iGoodsCollectService.getGoodsToCollect();
    }
}
